<?php

namespace Modules\Shop\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ArticleRequest extends FormRequest
{
    //表单提交的验证规则
    public function rules()
    {
        return [
            'title' => 'required',//标题 =>不能为空
            'author' => 'required',
            'category_id' => 'required',
            'content' => 'required',
            'thumb' => 'required',
        ];
    }

    //错误信息处理
    public function messages()
    {
        return [];

    }

    //权限验证
    public function authorize()
    {
        return true;
    }
}
